//
//  Recomend_Cell.m
//  car
//
//  Created by chenxu on 4/4/15.
//  Copyright (c) 2015 chenxu. All rights reserved.
//

#import "Recomend_Cell.h"

@interface Recomend_Cell()
@property (strong, nonatomic) UILabel *titleLabel;
@property (strong, nonatomic) UIImageView *background;

@end

@implementation Recomend_Cell

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        CGFloat leftpadding = 20;
        CGFloat toppadding = 5;
        self.accessoryType = UITableViewCellAccessoryNone;
        if (!_background) {
            

            _background = [[UIImageView alloc]initWithFrame:CGRectMake(leftpadding,toppadding , kScreen_Width-leftpadding * 2, self.contentView.frame.size.height-toppadding*2)];
            _background.layer.cornerRadius = kCornerRadius+2;
            _background.layer.masksToBounds =YES;
            _background.image = [UIImage imageWithColor:kColorTheme];
            [self.contentView addSubview:_background];
        }
        if (!_titleLabel) {
            _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(30, 2 , kScreen_Width-leftpadding * 2, self.contentView.frame.size.height-toppadding)];
            _titleLabel.backgroundColor = [UIColor clearColor];
            _titleLabel.font = [UIFont systemFontOfSize:16];
            _titleLabel.textColor = [UIColor whiteColor];
            [self.contentView addSubview:_titleLabel];
        }
       
        
    }
    return self;
}


- (void)setTitle:(NSString *)str{
    _titleLabel.text = str;
}
@end
